﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace LynxBlogAPI.Models.Mapping
{
    public class PostCategoryMap : EntityTypeConfiguration<PostCategory>
    {
        public PostCategoryMap()
        {
            this.HasKey(t => t.postcategoryid);

            this.Property(t => t.postcategoryid).HasColumnName("PostCategoryId").HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
            this.Property(t => t.postid).HasColumnName("PostId").IsRequired();
            this.Property(t => t.category).HasColumnName("CategoryId").IsRequired();
            this.ToTable("tblPostCategory");
        }
    }
}